<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Chat Room</title>
  <link rel="stylesheet" href="theme.css">
</head>
<body>
  <div id="app">
    <div class="main">

      <!-- Videos -->
      <div class="left">
        <div class="video">
          <video ref="preview" muted autoplay></video>
        </div>

        <div>
          <label for="deviceSelector">Select Input Device:</label>
          <select name="device" id="deviceSelector" v-model="selectedDeviceIndex">
            <option v-for="(d, i) in inputDevices" v-bind:value="i">
              {{ d.label ? d.label : d.kind === 'audioinput' ? '未知麦克风' : d.kind === 'videoinput' ? '未知摄像头' : '未知设备' }}
            </option>
          </select>
        </div>

        <div>
          <button v-on:click="startRecord" v-bind:disabled="startBtnDisabled">Start</button>
          <button v-on:click="pauseRecord" v-bind:disabled="pauseBtnDisabled">Pause</button>
          <button v-on:click="resumeRecord" v-bind:disabled="resumeBtnDisabled">Resume</button>
          <button v-on:click="stopRecord" v-bind:disabled="stopBtnDisabled">Stop</button>
        </div>
      </div>

      <!-- Messages -->
      <div class="right">
        <div ref="messageView" class="messages">
          <div class="popup" v-for="item in messages">
            <div class="avatar">{{ item.name }}</div>
            <div class="content">{{ item.content }}</div>
          </div>
        </div>
        <label>
          <textarea rows="2" v-on:keydown.prevent.enter="sendMessage" v-model:value="unSubmitMessage"></textarea>
        </label>
      </div>

    </div>

    <!--<div class="config"><i>Test config</i></div>-->
  </div>
  <script src="node_modules/vue/dist/vue.js"></script>
  <script src="main.js"></script>
</body>
</html>
